clean code and logs during bulk upload
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Thu, 27 Mar 2025 14:33:00 +0000 (15:33 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Thu, 10 Apr 2025 12:55:41 +0000 (14:55 +0200)
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/bulkpropagatorjob.cpp
src/libsync/owncloudpropagator.cpp
src/libsync/putmultifilejob.cpp

index c03a82324b10a0440028b0120f53364c871ce9db..80d17d1c9c1965030b1c13bb71be134ed92c577f 100644 (file)
@@ -585,7 +585,7 @@ void BulkPropagatorJob::finalizeOneFile(const BulkUploadItem &oneFile)
 
 void BulkPropagatorJob::finalize(const QJsonObject &fullReply)
 {
-    qCDebug(lcBulkPropagatorJob) << "Received a full reply" << fullReply;
+    qCDebug(lcBulkPropagatorJob) << "Received a full reply" << QJsonDocument::fromVariant(fullReply).toJson();
 
     for(auto singleFileIt = std::begin(_filesToUpload); singleFileIt != std::end(_filesToUpload); ) {
         const auto &singleFile = *singleFileIt;
index 8e4e6b0b307c7e38fa39dc57b41406fdfad312e8..969a8ba031afc30f2d63294381df3e34bc7a7c5b 100644 (file)
@@ -1267,7 +1267,9 @@ bool PropagatorCompositeJob::scheduleSelfOrChild()
         _tasksToDo.remove(0);
         PropagatorJob *job = propagator()->createJob(nextTask);
         if (!job) {
-            qCWarning(lcDirectory) << "Useless task found for file" << nextTask->destination() << "instruction" << nextTask->_instruction;
+            if (!propagator()->isDelayedUploadItem(nextTask)) {
+                qCWarning(lcDirectory) << "Useless task found for file" << nextTask->destination() << "instruction" << nextTask->_instruction;
+            }
             continue;
         }
         appendJob(job);
index 5c132de33d19babd4091089fdb0ff95b9146834f..988db43a2a9f7c71d078e71728914b63b9d9ac50 100644 (file)
@@ -100,13 +100,8 @@ bool PutMultiFileJob::finished()
             if (!oneDevice._device->errorString().isEmpty()) {
                 qCWarning(lcPutMultiFileJob) << "oneDevice has error:" << oneDevice._device->errorString();
             }
-        }
 
-        if (oneDevice._device->isOpen()) {
             oneDevice._device->close();
-        } else {
-            qCWarning(lcPutMultiFileJob) << "Did not close device" << oneDevice._device.get()
-                                         << "as it was not open";
         }
     }